''' 环境管理器
里面要有两个函数，__enter__和__exit__,可以使用with
'''


class A():

    def __enter__(self):
        return self

    def __exit__(self, exc_type, exc_val, exc_tb):
        '''

        :param exc_type: 根据这个来处理问题
        :param exc_val: 错误具体值
        :param exc_tb: 溯源，找到某个位置
        :return:
        '''

        if exc_type is None:
            print('一切正常')
        else:
            print('有问题')
            print(exc_type)
            print(exc_val)
            print(exc_tb)


with A() as a:
    int(input("请输入数值："))